package jacob;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class Explosive_Wand extends ItemSword
{

	public Explosive_Wand(int par1, EnumToolMaterial par2EnumToolMaterial) 
	{
		super(par1, par2EnumToolMaterial);
		// TODO Auto-generated constructor stub
	}
	public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
	{
		// the 200 sets how far you can set the explosion from
		MovingObjectPosition coord= par3EntityPlayer.rayTrace(200, 1);
		if(coord!=null)
		{
			//the 100 is how big the explosion is
			par2World.createExplosion(par3EntityPlayer, coord.blockX, coord.blockY, coord.blockZ, 100, true);
		}
		return par1ItemStack;
	}
	
	public void registerIcons(IconRegister iconReg)
	{
		itemIcon = iconReg.registerIcon("iDTechModBase:Explosive Wand");

	}
}
	
    